#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
int main()
{
	int arr[50][50] = { 0 };
	int m = 0; int n = 0; int i = 0; int j = 0;
	scanf("%d %d", &m, &n);
	for (i = 0; i < m; i++)
	{
		arr[i][0] = 1;
	}
	for (j= 0; j < m; j++)
	{
		for (i = 0; i < n; i++)
		{
			if (i == j)
				arr[i][j] = 1;
			else
				arr[i][j] = arr[i - 1][j - 1] + arr[i - 1][j];
		}
		printf("\n");
	}
	for (i = 0; i < m; i++)
	{
		for (j = 0; j < n; j++)
			printf("%5d", arr[j][i]);
	}
	return 0;
}